package cn.buk.tms.eotms.report.dto;

import cn.buk.tms.common.dto.flight.BaseChangeOrderFlightDto;
import cn.buk.tms.eotms.entity.FlightInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 用于报表的改签
 * @author william
 *
 */
public class ReportFlightChangeDto extends ReportBaseDto{

	private String balanceCode;

	private String ticketNo;
	/**
	 * 乘机人姓名
	 */
	private String name;

	@JsonIgnore
	private String routeDetail;

	private final double airChangeCharge; // 航司改签费
	private final String newTicketNo;

	private final int intlTicket;

	/**
	 * 公布运价
	 */
	private double parValue;

	public ReportFlightChangeDto(String balanceCode, String ticketNo, Date opDate, String passengerName, String routeDetail,
                                 double parvalue, double tax, double airChangeCharge, double serviceCharge,
                                 String newTicketNo, int intlTicket,
                                 String op1, int billId, String bePaid0) {
		super(op1, opDate, billId, airChangeCharge + serviceCharge,
						bePaid0 == null ? 0 : Integer.parseInt(bePaid0));

		this.balanceCode = balanceCode;
		this.ticketNo = ticketNo;
		this.name = passengerName;
		this.routeDetail = routeDetail;

		this.parValue = parvalue;
		this.tax = tax;
		this.airChangeCharge = airChangeCharge; // 航司退票费
		this.serviceCharge = serviceCharge; // 服务费

		this.newTicketNo = newTicketNo;

		this.intlTicket = intlTicket;

	}

	private double tax;

	private double serviceCharge;

	private List<BaseChangeOrderFlightDto> flights;


	public String getTicketNo() {
		return ticketNo;
	}

	public void setTicketNo(String ticketNo) {
		this.ticketNo = ticketNo;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}


	public double getParValue() {
		return parValue;
	}

	public void setParValue(double parValue) {
		this.parValue = parValue;
	}

	public double getTax() {
		return tax;
	}

	public void setTax(double tax) {
		this.tax = tax;
	}

	public double getServiceCharge() {
		return serviceCharge;
	}

	public void setServiceCharge(double serviceCharge) {
		this.serviceCharge = serviceCharge;
	}

	public String getBalanceCode() {
		return balanceCode;
	}

	public void setBalanceCode(String balanceCode) {
		this.balanceCode = balanceCode;
	}

	public String getRouteDetail() {
		if (routeDetail == null) {
      return "";
    } else {
      return routeDetail;
    }
	}

	public void setRouteDetail(String routeDetail) {
		this.routeDetail = routeDetail;
	}


	public List<BaseChangeOrderFlightDto> getFlights() {
		if (flights == null) {
      flights = new ArrayList<>();
    }
		return flights;
	}


	public double getAirChangeCharge() {
		return airChangeCharge;
	}

	public String getNewTicketNo() {
		return newTicketNo;
	}

	public int getIntlTicket() {
		return intlTicket;
	}
}
